import { Component, Input } from '@angular/core';
import { Article } from './article/article.module';

@Component({
  selector: 'app-article',
  templateUrl: './article.component.html',
  styleUrls: ['./article.component.scss'],
  host: {
    class: "row"
  }
})
export class ArticleComponent {
   @Input() article:Article
   constructor(){
    this.article = new Article(
      'Angular 2',
      'http://angular.io',
      10
    )
   }
   voteUp():boolean{
    // 调用 Article 里的 方法
      this.article.voteUp()
      return false
   }
   voteDown():boolean{
    this.article.voteDown()
    return false
   }
}
